import Mock from "mockjs-async";

import mockAPI from "./user";

// 用户相关
Mock.mock(/\/user\/getUser/, "get", (args) => {
  return new Promise(resolve => {
    resolve(mockAPI.selectOneUser(args));
  })
});
Mock.mock(/\/user\/all/, "get", (args) => {
  return new Promise(resolve => {
    resolve(mockAPI.selectAllUser(args));
  });
})
Mock.mock(/\/user\/remove/, "post", (args) => {
  return new Promise(resolve => {
    resolve(mockAPI.deleteUser(args));
  })
});
Mock.mock(/\/user\/batchremove/, "get", (args) => {
  return new Promise(resolve => {
    resolve(mockAPI.batchremove(args));
  });
});
Mock.mock(/\/user\/add/, "post", (args) => {
  return new Promise(resolve => {
    resolve(mockAPI.createUser(args));
  });
});
Mock.mock(/\/user\/edit/, "post", (args) => {
  return new Promise(resolve => {
    resolve(mockAPI.updateUser(args));
  });
});


